package com.woniuxy.info.replies.client;

import com.woniuxy.info.sys.entity.Informations;
import com.woniuxy.info.sys.result.Result;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "info-sys")
public interface InfoApi {

    @ApiOperation("分页查询资讯列表")
    @GetMapping("/informations/query")
    Result queryInfoList(
            @RequestParam(name = "current",defaultValue = "1") Integer current,
            @RequestParam(name = "size",defaultValue = "5") Integer size);

    @ApiOperation("资讯详情")
    @GetMapping("/informations/{id}")
    Result<Informations> findInfoById(
            @PathVariable("id")
            @ApiParam(name ="id",value ="资讯ID",required = true) Integer id);

    @PutMapping("/informations/reply/count/{infoId}")
    @ApiOperation("修改资讯评论数量")
    Result<Integer> updateReplyCount(
            @PathVariable("infoId")
            @ApiParam(name ="infoId",value ="资讯ID",required = true) Integer infoId);


}
